﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace FindHyperLinks
{
    class HyperLinks
    {
        static void Main(string[] args)
        {
            string text = "www.cs-tusofia.bg   http://forplay.bg";

            string wwwPattern = @"www\.[-_\w]*\.\w{2,4}";
            string httpPattern = @"http://\w+";

            Match wwwLinkMatcher = Regex.Match(text, wwwPattern);
            if (wwwLinkMatcher.Success) 
            {
                Console.WriteLine("{0} is link",wwwLinkMatcher);
            }

            Match httpMatcher = Regex.Match(text,httpPattern);
            if (httpMatcher.Success)
            {
                Console.WriteLine("{0} is link", httpMatcher);
            }
        }
    }
}
